//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.tencent.bugly.crashreport;

import android.annotation.SuppressLint;
import android.content.Context;
import android.os.Build.VERSION;
import android.text.TextUtils;
import android.util.Log;
import android.webkit.WebSettings;
import android.webkit.WebView;
import com.tencent.bugly.BuglyStrategy;
import com.tencent.bugly.CrashModule;
import com.tencent.bugly.b;
import com.tencent.bugly.crashreport.common.info.a;
import com.tencent.bugly.crashreport.common.strategy.StrategyBean;
import com.tencent.bugly.crashreport.crash.BuglyBroadcastReceiver;
import com.tencent.bugly.crashreport.crash.c;
import com.tencent.bugly.crashreport.crash.d;
import com.tencent.bugly.crashreport.crash.h5.H5JavaScriptInterface;
import com.tencent.bugly.crashreport.crash.jni.NativeCrashHandler;
import com.tencent.bugly.proguard.q;
import com.tencent.bugly.proguard.w;
import com.tencent.bugly.proguard.x;
import com.tencent.bugly.proguard.z;
import java.net.InetAddress;
import java.net.Proxy;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

public class CrashReport {
    private static Context a;

    public CrashReport() {
    }

    public static void enableBugly(boolean var0) {
        b.a = var0;
    }

    public static void initCrashReport(Context var0) {
        if (var0 != null) {
            a = var0;
            if (com.tencent.bugly.crashreport.common.info.a.a(var0) != null && "oversea".equals(com.tencent.bugly.crashreport.common.info.a.a(var0).z)) {
                StrategyBean.b = "http://astat.bugly.qcloud.com/rqd/async";
                StrategyBean.c = "http://astat.bugly.qcloud.com/rqd/async";
            }

            b.a(CrashModule.getInstance());
            b.a(var0);
        }
    }

    public static void initCrashReport(Context var0, CrashReport.UserStrategy var1) {
        if (var0 != null) {
            a = var0;
            if (com.tencent.bugly.crashreport.common.info.a.a(var0) != null && "oversea".equals(com.tencent.bugly.crashreport.common.info.a.a(var0).z)) {
                StrategyBean.b = "http://astat.bugly.qcloud.com/rqd/async";
                StrategyBean.c = "http://astat.bugly.qcloud.com/rqd/async";
            }

            b.a(CrashModule.getInstance());
            b.a(var0, var1);
        }
    }

    public static void initCrashReport(Context var0, String var1, boolean var2) {
        initCrashReport(var0, var1, var2, null);
    }

    public static void initCrashReport(Context var0, String var1, boolean var2, CrashReport.UserStrategy var3) {
        if (var0 != null) {
            if (com.tencent.bugly.crashreport.common.info.a.a(var0) != null && "oversea".equals(com.tencent.bugly.crashreport.common.info.a.a(var0).z)) {
                StrategyBean.b = "http://astat.bugly.qcloud.com/rqd/async";
                StrategyBean.c = "http://astat.bugly.qcloud.com/rqd/async";
            }

            a = var0;
            b.a(CrashModule.getInstance());
            b.a(var0, var1, var2, var3);
        }
    }

    public static String getBuglyVersion(Context var0) {
        if (var0 == null) {
            x.d("Please call with context.");
            return "unknown";
        } else {
            return com.tencent.bugly.crashreport.common.info.a.a(var0).c();
        }
    }

    public static void testJavaCrash() {
        if (!b.a) {
            Log.w(x.a, "Can not test Java crash because bugly is disable.");
        } else if (!CrashModule.getInstance().hasInitialized()) {
            Log.e(x.a, "CrashReport has not been initialed! pls to call method 'initCrashReport' first!");
        } else {
            a var0;
            if ((var0 = com.tencent.bugly.crashreport.common.info.a.b()) != null) {
                var0.b(24096);
            }

            throw new RuntimeException("This Crash create for Test! You can go to Bugly see more detail!");
        }
    }

    public static void testNativeCrash() {
        testNativeCrash(false, false, false);
    }

    public static void testNativeCrash(boolean var0, boolean var1, boolean var2) {
        if (!b.a) {
            Log.w(x.a, "Can not test native crash because bugly is disable.");
        } else if (!CrashModule.getInstance().hasInitialized()) {
            Log.e(x.a, "CrashReport has not been initialed! pls to call method 'initCrashReport' first!");
        } else {
            x.a("start to create a native crash for test!");
            c.a().a(var0, var1, var2);
        }
    }

    public static void testANRCrash() {
        if (!b.a) {
            Log.w(x.a, "Can not test ANR crash because bugly is disable.");
        } else if (!CrashModule.getInstance().hasInitialized()) {
            Log.e(x.a, "CrashReport has not been initialed! pls to call method 'initCrashReport' first!");
        } else {
            x.a("start to create a anr crash for test!");
            c.a().j();
        }
    }

    public static void postException(Thread var0, int var1, String var2, String var3, String var4, Map<String, String> var5) {
        if (!b.a) {
            Log.w(x.a, "Can not post crash caught because bugly is disable.");
        } else if (!CrashModule.getInstance().hasInitialized()) {
            Log.e(x.a, "CrashReport has not been initialed! pls to call method 'initCrashReport' first!");
        } else {
            d.a(var0, var1, var2, var3, var4, var5);
        }
    }

    public static void postException(int var0, String var1, String var2, String var3, Map<String, String> var4) {
        postException(Thread.currentThread(), var0, var1, var2, var3, var4);
    }

    public static void postCatchedException(Throwable var0) {
        Thread var1 = Thread.currentThread();
        postCatchedException(var0, var1, false);
    }

    public static void postCatchedException(Throwable var0, Thread var1) {
        postCatchedException(var0, var1, false);
    }

    public static void postCatchedException(Throwable var0, Thread var1, boolean var2) {
        if (!b.a) {
            Log.w(x.a, "Can not post crash caught because bugly is disable.");
        } else if (!CrashModule.getInstance().hasInitialized()) {
            Log.e(x.a, "CrashReport has not been initialed! pls to call method 'initCrashReport' first!");
        } else if (var0 == null) {
            x.d("throwable is null, just return");
        } else {
            if (var1 == null) {
                var1 = Thread.currentThread();
            }

            c.a().a(var1, var0, false, null, null, var2);
        }
    }

    public static void closeNativeReport() {
        if (!b.a) {
            Log.w(x.a, "Can not close native report because bugly is disable.");
        } else if (!CrashModule.getInstance().hasInitialized()) {
            Log.e(x.a, "CrashReport has not been initialed! pls to call method 'initCrashReport' first!");
        } else {
            c.a().f();
        }
    }

    public static void startCrashReport() {
        if (!b.a) {
            Log.w(x.a, "Can not start crash report because bugly is disable.");
        } else if (!CrashModule.getInstance().hasInitialized()) {
            Log.w(x.a, "CrashReport has not been initialed! pls to call method 'initCrashReport' first!");
        } else {
            c.a().c();
        }
    }

    public static void closeCrashReport() {
        if (!b.a) {
            Log.w(x.a, "Can not close crash report because bugly is disable.");
        } else if (!CrashModule.getInstance().hasInitialized()) {
            Log.w(x.a, "CrashReport has not been initialed! pls to call method 'initCrashReport' first!");
        } else {
            c.a().d();
        }
    }

    public static void closeBugly() {
        if (!b.a) {
            Log.w(x.a, "Can not close bugly because bugly is disable.");
        } else if (!CrashModule.getInstance().hasInitialized()) {
            Log.w(x.a, "CrashReport has not been initialed! pls to call method 'initCrashReport' first!");
        } else if (a != null) {
            BuglyBroadcastReceiver var0;
            if ((var0 = BuglyBroadcastReceiver.getInstance()) != null) {
                var0.unregister(a);
            }

            closeCrashReport();
            com.tencent.bugly.crashreport.biz.b.a(a);
            w var1;
            if ((var1 = w.a()) != null) {
                var1.b();
            }

        }
    }

    public static void setUserSceneTag(Context var0, int var1) {
        if (!b.a) {
            Log.w(x.a, "Can not set tag caught because bugly is disable.");
        } else if (var0 == null) {
            Log.e(x.a, "setTag args context should not be null");
        } else {
            if (var1 <= 0) {
                x.d("setTag args tagId should > 0");
            }

            com.tencent.bugly.crashreport.common.info.a.a(var0).a(var1);
            x.b("[param] set user scene tag: %d", var1);
        }
    }

    public static int getUserSceneTagId(Context var0) {
        if (!b.a) {
            Log.w(x.a, "Can not get user scene tag because bugly is disable.");
            return -1;
        } else if (var0 == null) {
            Log.e(x.a, "getUserSceneTagId args context should not be null");
            return -1;
        } else {
            return com.tencent.bugly.crashreport.common.info.a.a(var0).H();
        }
    }

    public static String getUserData(Context var0, String var1) {
        if (!b.a) {
            Log.w(x.a, "Can not get user data because bugly is disable.");
            return "unknown";
        } else if (var0 == null) {
            Log.e(x.a, "getUserDataValue args context should not be null");
            return "unknown";
        } else {
            return z.a(var1) ? null : com.tencent.bugly.crashreport.common.info.a.a(var0).g(var1);
        }
    }

    public static void putUserData(Context var0, String var1, String var2) {
        if (!b.a) {
            Log.w(x.a, "Can not put user data because bugly is disable.");
        } else if (var0 == null) {
            Log.w(x.a, "putUserData args context should not be null");
        } else if (var1 == null) {
            x.d("putUserData args key should not be null or empty");
        } else if (var2 == null) {
            x.d("putUserData args value should not be null");
        } else if (!var1.matches("[a-zA-Z[0-9]]+")) {
            x.d("putUserData args key should match [a-zA-Z[0-9]]+  {" + var1 + "}");
        } else {
            if (var2.length() > 200) {
                x.d("user data value length over limit %d, it will be cutted!", 200);
                var2 = var2.substring(0, 200);
            }

            a var3;
            NativeCrashHandler var4;
            if ((var3 = com.tencent.bugly.crashreport.common.info.a.a(var0)).E().contains(var1)) {
                if ((var4 = NativeCrashHandler.getInstance()) != null) {
                    var4.putKeyValueToNative(var1, var2);
                }

                com.tencent.bugly.crashreport.common.info.a.a(var0).b(var1, var2);
                x.c("replace KV %s %s", var1, var2);
            } else if (var3.D() >= 10) {
                x.d("user data size is over limit %d, it will be cutted!", 10);
            } else {
                if (var1.length() > 50) {
                    x.d("user data key length over limit %d , will drop this new key %s", 50, var1);
                    var1 = var1.substring(0, 50);
                }

                if ((var4 = NativeCrashHandler.getInstance()) != null) {
                    var4.putKeyValueToNative(var1, var2);
                }

                com.tencent.bugly.crashreport.common.info.a.a(var0).b(var1, var2);
                x.b("[param] set user data: %s - %s", var1, var2);
            }
        }
    }

    public static String removeUserData(Context var0, String var1) {
        if (!b.a) {
            Log.w(x.a, "Can not remove user data because bugly is disable.");
            return "unknown";
        } else if (var0 == null) {
            Log.e(x.a, "removeUserData args context should not be null");
            return "unknown";
        } else if (z.a(var1)) {
            return null;
        } else {
            x.b("[param] remove user data: %s", var1);
            return com.tencent.bugly.crashreport.common.info.a.a(var0).f(var1);
        }
    }

    public static Set<String> getAllUserDataKeys(Context var0) {
        if (!b.a) {
            Log.w(x.a, "Can not get all keys of user data because bugly is disable.");
            return new HashSet<>();
        } else if (var0 == null) {
            Log.e(x.a, "getAllUserDataKeys args context should not be null");
            return new HashSet<>();
        } else {
            return com.tencent.bugly.crashreport.common.info.a.a(var0).E();
        }
    }

    public static int getUserDatasSize(Context var0) {
        if (!b.a) {
            Log.w(x.a, "Can not get size of user data because bugly is disable.");
            return -1;
        } else if (var0 == null) {
            Log.e(x.a, "getUserDatasSize args context should not be null");
            return -1;
        } else {
            return com.tencent.bugly.crashreport.common.info.a.a(var0).D();
        }
    }

    public static String getAppID() {
        if (!b.a) {
            Log.w(x.a, "Can not get App ID because bugly is disable.");
            return "unknown";
        } else if (!CrashModule.getInstance().hasInitialized()) {
            Log.e(x.a, "CrashReport has not been initialed! pls to call method 'initCrashReport' first!");
            return "unknown";
        } else {
            return com.tencent.bugly.crashreport.common.info.a.a(a).f();
        }
    }

    public static void setUserId(String var0) {
        if (!b.a) {
            Log.w(x.a, "Can not set user ID because bugly is disable.");
        } else if (!CrashModule.getInstance().hasInitialized()) {
            Log.e(x.a, "CrashReport has not been initialed! pls to call method 'initCrashReport' first!");
        } else {
            setUserId(a, var0);
        }
    }

    public static void setUserId(Context var0, String var1) {
        if (!b.a) {
            Log.w(x.a, "Can not set user ID because bugly is disable.");
        } else if (var0 == null) {
            Log.e(x.a, "Context should not be null when bugly has not been initialed!");
        } else if (TextUtils.isEmpty(var1)) {
            x.d("userId should not be null");
        } else {
            if (var1.length() > 100) {
                String var2 = var1.substring(0, 100);
                x.d("userId %s length is over limit %d substring to %s", var1, 100, var2);
                var1 = var2;
            }

            if (!var1.equals(com.tencent.bugly.crashreport.common.info.a.a(var0).g())) {
                com.tencent.bugly.crashreport.common.info.a.a(var0).b(var1);
                x.b("[user] set userId : %s", var1);
                NativeCrashHandler var3;
                if ((var3 = NativeCrashHandler.getInstance()) != null) {
                    var3.setNativeUserId(var1);
                }

                if (CrashModule.getInstance().hasInitialized()) {
                    com.tencent.bugly.crashreport.biz.b.a();
                }

            }
        }
    }

    public static String getUserId() {
        if (!b.a) {
            Log.w(x.a, "Can not get user ID because bugly is disable.");
            return "unknown";
        } else if (!CrashModule.getInstance().hasInitialized()) {
            Log.e(x.a, "CrashReport has not been initialed! pls to call method 'initCrashReport' first!");
            return "unknown";
        } else {
            return com.tencent.bugly.crashreport.common.info.a.a(a).g();
        }
    }

    public static String getAppVer() {
        if (!b.a) {
            Log.w(x.a, "Can not get app version because bugly is disable.");
            return "unknown";
        } else if (!CrashModule.getInstance().hasInitialized()) {
            Log.e(x.a, "CrashReport has not been initialed! pls to call method 'initCrashReport' first!");
            return "unknown";
        } else {
            return com.tencent.bugly.crashreport.common.info.a.a(a).k;
        }
    }

    public static String getAppChannel() {
        if (!b.a) {
            Log.w(x.a, "Can not get App channel because bugly is disable.");
            return "unknown";
        } else if (!CrashModule.getInstance().hasInitialized()) {
            Log.e(x.a, "CrashReport has not been initialed! pls to call method 'initCrashReport' first!");
            return "unknown";
        } else {
            return com.tencent.bugly.crashreport.common.info.a.a(a).m;
        }
    }

    public static void setContext(Context var0) {
        a = var0;
    }

    public static boolean isLastSessionCrash() {
        if (!b.a) {
            Log.w(x.a, "The info 'isLastSessionCrash' is not accurate because bugly is disable.");
            return false;
        } else if (!CrashModule.getInstance().hasInitialized()) {
            Log.e(x.a, "CrashReport has not been initialed! pls to call method 'initCrashReport' first!");
            return false;
        } else {
            return c.a().b();
        }
    }

    public static void setSdkExtraData(Context var0, String var1, String var2) {
        if (!b.a) {
            Log.w(x.a, "Can not put SDK extra data because bugly is disable.");
        } else if (var0 != null && !z.a(var1) && !z.a(var2)) {
            com.tencent.bugly.crashreport.common.info.a.a(var0).a(var1, var2);
        }
    }

    public static Map<String, String> getSdkExtraData() {
        if (!b.a) {
            Log.w(x.a, "Can not get SDK extra data because bugly is disable.");
            return new HashMap<>();
        } else if (!CrashModule.getInstance().hasInitialized()) {
            Log.e(x.a, "CrashReport has not been initialed! pls to call method 'initCrashReport' first!");
            return null;
        } else {
            return com.tencent.bugly.crashreport.common.info.a.a(a).C;
        }
    }

    public static Map<String, String> getSdkExtraData(Context var0) {
        if (!b.a) {
            Log.w(x.a, "Can not get SDK extra data because bugly is disable.");
            return new HashMap<>();
        } else if (var0 == null) {
            x.d("Context should not be null.");
            return null;
        } else {
            return com.tencent.bugly.crashreport.common.info.a.a(var0).C;
        }
    }

    private static void putSdkData(Context var0, String var1, String var2) {
        if (var0 != null && !z.a(var1) && !z.a(var2)) {
            if ((var1 = var1.replace("[a-zA-Z[0-9]]+", "")).length() > 100) {
                Log.w(x.a, String.format("putSdkData key length over limit %d, will be cutted.", 50));
                var1 = var1.substring(0, 50);
            }

            if (var2.length() > 500) {
                Log.w(x.a, String.format("putSdkData value length over limit %d, will be cutted!", 200));
                var2 = var2.substring(0, 200);
            }

            com.tencent.bugly.crashreport.common.info.a.a(var0).c(var1, var2);
            x.b(String.format("[param] putSdkData data: %s - %s", var1, var2));
        }
    }

    public static void setIsAppForeground(Context var0, boolean var1) {
        if (!b.a) {
            Log.w(x.a, "Can not set 'isAppForeground' because bugly is disable.");
        } else if (var0 == null) {
            x.d("Context should not be null.");
        } else {
            if (var1) {
                x.c("App is in foreground.");
            } else {
                x.c("App is in background.");
            }

            com.tencent.bugly.crashreport.common.info.a.a(var0).a(var1);
        }
    }

    public static void setIsDevelopmentDevice(Context var0, boolean var1) {
        if (!b.a) {
            Log.w(x.a, "Can not set 'isDevelopmentDevice' because bugly is disable.");
        } else if (var0 == null) {
            x.d("Context should not be null.");
        } else {
            if (var1) {
                x.c("This is a development device.");
            } else {
                x.c("This is not a development device.");
            }

            com.tencent.bugly.crashreport.common.info.a.a(var0).A = var1;
        }
    }

    public static void setSessionIntervalMills(long var0) {
        if (!b.a) {
            Log.w(x.a, "Can not set 'SessionIntervalMills' because bugly is disable.");
        } else {
            com.tencent.bugly.crashreport.biz.b.a(var0);
        }
    }

    public static void setAppVersion(Context var0, String var1) {
        if (!b.a) {
            Log.w(x.a, "Can not set App version because bugly is disable.");
        } else if (var0 == null) {
            Log.w(x.a, "setAppVersion args context should not be null");
        } else if (var1 == null) {
            Log.w(x.a, "App version is null, will not set");
        } else {
            com.tencent.bugly.crashreport.common.info.a.a(var0).k = var1;
            NativeCrashHandler var2;
            if ((var2 = NativeCrashHandler.getInstance()) != null) {
                var2.setNativeAppVersion(var1);
            }

        }
    }

    public static void setAppChannel(Context var0, String var1) {
        if (!b.a) {
            Log.w(x.a, "Can not set App channel because Bugly is disable.");
        } else if (var0 == null) {
            Log.w(x.a, "setAppChannel args context should not be null");
        } else if (var1 == null) {
            Log.w(x.a, "App channel is null, will not set");
        } else {
            com.tencent.bugly.crashreport.common.info.a.a(var0).m = var1;
            NativeCrashHandler var2;
            if ((var2 = NativeCrashHandler.getInstance()) != null) {
                var2.setNativeAppChannel(var1);
            }

        }
    }

    public static void setAppPackage(Context var0, String var1) {
        if (!b.a) {
            Log.w(x.a, "Can not set App package because bugly is disable.");
        } else if (var0 == null) {
            Log.w(x.a, "setAppPackage args context should not be null");
        } else if (var1 == null) {
            Log.w(x.a, "App package is null, will not set");
        } else {
            com.tencent.bugly.crashreport.common.info.a.a(var0).c = var1;
            NativeCrashHandler var2;
            if ((var2 = NativeCrashHandler.getInstance()) != null) {
                var2.setNativeAppPackage(var1);
            }

        }
    }

    public static void setCrashFilter(String var0) {
        if (!b.a) {
            Log.w(x.a, "Can not set App package because bugly is disable.");
        } else {
            Log.i(x.a, "Set crash stack filter: " + var0);
            c.n = var0;
        }
    }

    public static void setCrashRegularFilter(String var0) {
        if (!b.a) {
            Log.w(x.a, "Can not set App package because bugly is disable.");
        } else {
            Log.i(x.a, "Set crash stack filter: " + var0);
            c.o = var0;
        }
    }

    public static void setHandleNativeCrashInJava(boolean var0) {
        if (!b.a) {
            Log.w(x.a, "Can not set App package because bugly is disable.");
        } else {
            Log.i(x.a, "Should handle native crash in Java profile after handled in native profile: " + var0);
            NativeCrashHandler.setShouldHandleInJava(var0);
        }
    }

    public static void setBuglyDbName(String var0) {
        if (!b.a) {
            Log.w(x.a, "Can not set DB name because bugly is disable.");
        } else {
            Log.i(x.a, "Set Bugly DB name: " + var0);
            q.a = var0;
        }
    }

    public static void enableObtainId(Context var0, boolean var1) {
        if (!b.a) {
            Log.w(x.a, "Can not set DB name because bugly is disable.");
        } else if (var0 == null) {
            Log.w(x.a, "enableObtainId args context should not be null");
        } else {
            Log.i(x.a, "Enable identification obtaining? " + var1);
            com.tencent.bugly.crashreport.common.info.a.a(var0).b(var1);
        }
    }

    public static void setAuditEnable(Context var0, boolean var1) {
        if (!b.a) {
            Log.w(x.a, "Can not set App package because bugly is disable.");
        } else if (var0 == null) {
            Log.w(x.a, "setAppPackage args context should not be null");
        } else {
            Log.i(x.a, "Set audit enable: " + var1);
            com.tencent.bugly.crashreport.common.info.a.a(var0).D = var1;
        }
    }

    public static void setServerUrl(String var0) {
        if (!z.a(var0) && z.c(var0)) {
            com.tencent.bugly.crashreport.common.strategy.a.a(var0);
            StrategyBean.b = var0;
            StrategyBean.c = var0;
        } else {
            Log.i(x.a, "URL is invalid.");
        }
    }

    public static boolean setJavascriptMonitor(WebView var0, boolean var1) {
        return setJavascriptMonitor(var0, var1, false);
    }

    @SuppressLint({"SetJavaScriptEnabled"})
    public static boolean setJavascriptMonitor(final WebView var0, boolean var1, boolean var2) {
        if (var0 == null) {
            Log.w(x.a, "WebView is null.");
            return false;
        } else {
            return setJavascriptMonitor(new CrashReport.WebViewInterface() {
                public final String getUrl() {
                    return var0.getUrl();
                }

                public final void setJavaScriptEnabled(boolean var1) {
                    WebSettings var2;
                    if (!(var2 = var0.getSettings()).getJavaScriptEnabled()) {
                        var2.setJavaScriptEnabled(true);
                    }

                }

                public final void loadUrl(String var1) {
                    var0.loadUrl(var1);
                }

                public final void addJavascriptInterface(H5JavaScriptInterface var1, String var2) {
                    var0.addJavascriptInterface(var1, var2);
                }

                public final CharSequence getContentDescription() {
                    return var0.getContentDescription();
                }
            }, var1, var2);
        }
    }

    public static boolean setJavascriptMonitor(CrashReport.WebViewInterface var0, boolean var1) {
        return setJavascriptMonitor(var0, var1, false);
    }

    @SuppressLint({"SetJavaScriptEnabled"})
    public static boolean setJavascriptMonitor(CrashReport.WebViewInterface var0, boolean var1, boolean var2) {
        if (var0 == null) {
            Log.w(x.a, "WebViewInterface is null.");
            return false;
        } else if (!CrashModule.getInstance().hasInitialized()) {
            x.e("CrashReport has not been initialed! please to call method 'initCrashReport' first!");
            return false;
        } else {
            x.a("Set Javascript exception monitor of webview.");
            if (!b.a) {
                Log.w(x.a, "Can not set JavaScript monitor because bugly is disable.");
                return false;
            } else {
                x.c("URL of webview is %s", var0.getUrl());
                if (!var2 && VERSION.SDK_INT < 19) {
                    x.e("This interface is only available for Android 4.4 or later.");
                    return false;
                } else {
                    x.a("Enable the javascript needed by webview monitor.");
                    var0.setJavaScriptEnabled(true);
                    H5JavaScriptInterface var4;
                    if ((var4 = H5JavaScriptInterface.getInstance(var0)) != null) {
                        x.a("Add a secure javascript interface to the webview.");
                        var0.addJavascriptInterface(var4, "exceptionUploader");
                    }

                    if (var1) {
                        x.a("Inject bugly.js(v%s) to the webview.", com.tencent.bugly.crashreport.crash.h5.b.b());
                        String var3;
                        if ((var3 = com.tencent.bugly.crashreport.crash.h5.b.a()) == null) {
                            x.e("Failed to inject Bugly.js.", com.tencent.bugly.crashreport.crash.h5.b.b());
                            return false;
                        }

                        var0.loadUrl("javascript:" + var3);
                    }

                    return true;
                }
            }
        }
    }

    public static void setHttpProxy(String var0, int var1) {
        com.tencent.bugly.proguard.a.a(var0, var1);
    }

    public static void setHttpProxy(InetAddress var0, int var1) {
        com.tencent.bugly.proguard.a.a(var0, var1);
    }

    public static Proxy getHttpProxy() {
        return com.tencent.bugly.proguard.a.b();
    }

    public interface WebViewInterface {
        String getUrl();

        void setJavaScriptEnabled(boolean var1);

        void loadUrl(String var1);

        void addJavascriptInterface(H5JavaScriptInterface var1, String var2);

        CharSequence getContentDescription();
    }

    public static class CrashHandleCallback extends com.tencent.bugly.BuglyStrategy.a {
        public CrashHandleCallback() {
        }
    }

    public static class UserStrategy extends BuglyStrategy {
        private CrashReport.CrashHandleCallback c;

        public UserStrategy(Context var1) {
        }

        public synchronized void setCallBackType(int var1) {
            this.a = var1;
        }

        public synchronized int getCallBackType() {
            return this.a;
        }

        public synchronized void setCloseErrorCallback(boolean var1) {
            this.b = var1;
        }

        public synchronized boolean getCloseErrorCallback() {
            return this.b;
        }

        public synchronized CrashReport.CrashHandleCallback getCrashHandleCallback() {
            return this.c;
        }

        public synchronized void setCrashHandleCallback(CrashReport.CrashHandleCallback var1) {
            this.c = var1;
        }
    }
}
